package cloud.maque.demo1.controller;

import cloud.maque.common.core.response.R;
import cloud.maque.demo1.feign.Demo2Client;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/demo1")
public class Demo1Controller {

    @Autowired
    private Demo2Client demo2Client;

    @GetMapping("/test")
    public R<String> test() {
        return R.ok("Hello from Demo1");
    }

    @GetMapping("/call-demo2/{id}")
    public R<String> callDemo2(@PathVariable("id") String id) {
        return demo2Client.getDemo2Data(id);
    }
} 
